package com.huabo.system.oracle.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.system.oracle.entity.TblAcctBook;
import com.huabo.system.oracle.entity.TblAcquisitionRecord;

import java.math.BigDecimal;

public class TblAcctBookDaoSqlConfig {

    public String findByTypeNewZB(PageInfo<TblAcctBook> pageInfo,BigDecimal orgid) {
        StringBuffer sbSql = new StringBuffer("select * from (SELECT BUDGET.*,ROWNUM RNUM FROM  (SELECT * FROM TBL_ACCBOOK tb left join TBL_ORGANIZATION toz on tb.ORGID = toz.ORGID WHERE toz.ORGID = "+orgid+" AND tb.BOOKDESC IS NULL ORDER BY BOOKYEAR DESC");
        sbSql.append(") BUDGET WHERE ROWNUM <= "+(pageInfo.getCurrentPage()*pageInfo.getPageSize())+" ) WHERE RNUM > "+pageInfo.getCurrentRecord());
        return sbSql.toString();
    }



//    public String selectCountt(PageInfo<TblAcctBook> pageInfo) {
//        TblAcctBook tblAcctBook = new TblAcctBook();
//        StringBuffer sbSql = new StringBuffer("select COUNT(*) from (SELECT BUDGET.*,ROWNUM RNUM FROM  (SELECT * FROM TBL_ACCBOOK tab left JOIN TBL_ORGANIZATION toz on tab.ORGID =  "+tblAcctBook.getOrgId()+" WHERE toz.orgid = "+tblAcctBook.getOrgId()+"");
//        sbSql.append(") BUDGET WHERE ROWNUM <= "+(pageInfo.getCurrentPage()*pageInfo.getPageSize())+" ) WHERE RNUM > "+pageInfo.getCurrentRecord());
//        return sbSql.toString();
//    }
}
